<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl.'/js/all.js')?>
<?php Yii::app()->clientScript->registerScript('user-form-script',"
            jQuery('.form').find('button:last').click(function(e){

                var hostname = location.hostname;
                var protocol = location.protocol;
                var href = location.href;
                document.location.replace(protocol+'//'+hostname+'/user/backend/admin');
            });
")?>
<?php
/* @var $this BackendController */
/* @var $model NoteForm */

$this->breadcrumbs=array(
    'Users'=>array('index'),
    $model->name,
);?>

<div class="panel panel-primary">
    <div class="panel-heading">
       <i class="fa fa-envelope-o"></i><span class="h4"><?php echo Yii::t('UserModule.base','Sending notifications to the user').'&nbsp'.'<b>'.$model->name.'</b>' ?></span>
    </div>

    <div class="alert alert-info">
        <strong><?php echo Yii::t('UserModule.base','Warning!')?></strong>&nbsp<i><?php echo Yii::t('UserModule.base','Fields with');?><span class="required"> * </span> <?php echo Yii::t('UserModule.base','are required.');?></i>
    </div>

    <div class="form" style="padding:5px">
        <?php $form=$this->beginWidget('TActiveForm', array(
            'id'=>'user-form',
            'enableAjaxValidation'=>true,
            'enableClientValidation'=>true,
            'clientOptions'=>array(

                'afterValidate'=>'js:afterValidate',
                'validateOnSubmit'=>true,
                'validateOnType'=>true,
                'validateOnChange'=>true,
                'hideErrorMessage'=>true
            ),
        )); ?>

    <div class="panel-body">
        <div class="input-group">
                <?php echo $form->labelTb($model,'email'); ?>
                <?php echo $form->textFieldTb($model,'email'); ?>
                <?php echo $form->error($model,'email',array('afterValidateAttribute'=>'js:afterValidateAttribute')); ?>
         </div>


        <div class="input-group">
            <?php echo $form->labelTb($model,'message'); ?>
            <?php echo $form->textArea($model,'message',array('class'=>'textarea','cols'=>'80','rows'=>'10')); ?>
            <?php echo $form->error($model,'message',array('afterValidateAttribute'=>'js:afterValidateAttribute')); ?>
        </div>


        <div class = "buttons">
            <?php echo $form::cancelButtonTb('user/backend/admin')?>
            <?php echo $form::buttonTb('Submit',array('class'=>'btn btn-primary','data-icon'=>'fa fa-envelope'))?>
        </div>
        <?php $this->endWidget(); ?>
    </div><!--panel body-->

    </div><!--form-->
</div><!--panel-primary-->